package proto

import "smart-flow/server/job"

type CommonResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data"`
}

func NewCommonResp(errCode ErrorCode) *CommonResp {
	return &CommonResp{
		Code:    errCode.Code,
		Message: errCode.Message,
	}
}

func NewCommonRespWithData(errCode ErrorCode, data any) *CommonResp {
	return &CommonResp{
		Code:    errCode.Code,
		Message: errCode.Message,
		Data:    data,
	}
}

type CountsResp struct {
	CustomCount         int64 `json:"custom_count"`
	CtCount             int64 `json:"ct_count"`
	CmCount             int64 `json:"cm_count"`
	CuCount             int64 `json:"cu_count"`
	TotalCount          int64 `json:"total_count"`
	OnlineCount         int64 `json:"online_count"`
	CtOnlineCount       int64 `json:"ct_online_count"`
	CmOnlineCount       int64 `json:"cm_online_count"`
	CuOnlineCount       int64 `json:"cu_online_count"`
	OnlineFilterCount   int64 `json:"online_filter_count"`
	CtOnlineFilterCount int64 `json:"ct_online_filter_count"`
	CmOnlineFilterCount int64 `json:"cm_online_filter_count"`
	CuOnlineFilterCount int64 `json:"cu_online_filter_count"`
	UnknownOnlineCount  int64 `json:"unknown_online_count"`
}

type UidResp struct {
	Uid string `json:"uid"`
}

type TaskListResp struct {
	IspCtTask job.FlowJob `json:"isp_ct_task"`
	IspCmTask job.FlowJob `json:"isp_cm_task"`
	IspCuTask job.FlowJob `json:"isp_cu_task"`
}

type BandwidthResp struct {
	CustomBandwidth string `json:"custom_bandwidth"`
	CtBandWidth     string `json:"ct_bandwidth"`
	CmBandWidth     string `json:"cm_bandwidth"`
	CuBandWidth     string `json:"cu_bandwidth"`
}
